#ifndef _MENUFACTORY_H
#define _MENUFACTORY_H


#include "MenuComp.h"

class IMenuComponent;

class MenuFactory {
  public:
    inline IMenuComponent * createMenu() {
            IMenuComponent *Menu=new MenuComp();
            Menu->setDesc("Main Menu");
            Menu->add(createNewMenu());
            Menu->add(createLoadMenu());
            Menu->add(createSaveMenu());
            Menu->add(createOptionMenu());
            Menu->add(createPlayMenu());
            Menu->add(createExitMenu());
            return Menu;
        };


  private:
    virtual IMenuComponent * createNewMenu() = 0;

    virtual IMenuComponent * createLoadMenu() = 0;

    virtual IMenuComponent * createSaveMenu() = 0;

    virtual IMenuComponent * createOptionMenu() = 0;

    virtual IMenuComponent * createPlayMenu() = 0;

    virtual IMenuComponent * createExitMenu() = 0;

};
class myMenuFactory : public MenuFactory {
  private:
    IMenuComponent * createNewMenu() override;

    IMenuComponent * createLoadMenu() override;

    IMenuComponent * createSaveMenu() override;

    IMenuComponent * createOptionMenu() override;

    IMenuComponent * createPlayMenu() override;

    IMenuComponent * createExitMenu() override;

    void generate(IMenuComponent *pComponent, int time);

    void addBackMenuto(IMenuComponent *menu) const;
};
#endif
